<template lang="pug">
  span.zgplugin-button.zgplugin-empty(v-if="!exist&&editor")
    svg-icon.empty-icon(icon-class="组件按钮")
  span.zgplugin-button(v-else-if="exist")
    van-button(:class="{'button-native': !config.printVisible}" :style="{'color':config.color, 'backgroundColor': config.backgroundColor}" @click="throttleConfirm" :disabled="readonly" :nativeType="'button'") {{config.label}}
    dialog-template(v-if="visible" ref="dialogTemplate" @dialogCancel="dialogCancel" @dialogConfirm="dialogConfirm"  :dialogLoading="dialogLoading"  :dialogProperties="dialogProperties" :dialogList="dialogList" :sortable="rootForm.sortable" :dialogTitle="config.dialogTitle" :dialogHeight="config.dialogHeight" :dialogWidth="config.dialogWidth")
</template>
<script>
import renderCommon from '../common/renderCommon'
import dialogTemplate from './dialogTemplate'

export default {
  components: { dialogTemplate },
  mixins: [renderCommon]
}
</script>
<style lang="scss" scoped>
  .zgplugin-button {
    margin-top: 16px;
    display: inline-block;
  }
   @media print {
    .button-native {
      display: none;
    }
  }
</style>
